import {
    ProCard,
    ProForm,
    ProFormGroup,
    ProFormList,
    ProFormText,
  } from "@ant-design/pro-components";
  import { Badge, Collapse, Form, Input, Select } from "antd";
  
  const { Panel } = Collapse;
  const Demo = () => {
    return (
      <ProForm onFinish={async (e) => console.log(e)}>
        <ProFormList
          name="users"
          label="产品信息"
          deleteIconProps={false} // 如果你还想隐藏删除行的图标
          creatorButtonProps={false} // 隐藏添加新行的按钮
          copyIconProps={false} // 如果你也想隐藏复制行的图标
          initialValue={[
            {
              name: "1111",
              nickName: "2222",
              test1: "3333",
              labels: [
                {
                  value: "qqqq",
                  label: "eeeee",
                },
              ],
            },
            {
              name: "2222",
              nickName: "2222",
              test1: "3333",
              labels: [
                {
                  value: "qqqq",
                  label: "eeeee",
                },
                {
                  value: "qqqq",
                  label: "eeeee",
                },
              ],
            },
            {
              name: "3333",
              nickName: "2222",
              test1: "3333",
              labels: [
                {
                  value: "qqqq",
                  label: "eeeee",
                },
              ],
            },
          ]}
          itemRender={({ listDom, action }, { record }) => {
            console.log(record, "record");
  
            return (
              <ProCard
                bordered
                extra={action}
                title={
                  1
                  // <ProFormGroup style={{ padding: "10px" }}>
                  //   <ProFormText name="name" label="产品码" />
                  //   <ProFormText name="nickName" label="产品版本" />
                  //   <ProForm.Item name="test1" label="测试1">
                  //     <Select
                  //       options={[
                  //         {
                  //           value: "333",
                  //           label: "333",
                  //         },
                  //       ]}
                  //     />
                  //   </ProForm.Item>
                  // </ProFormGroup>
                }
              >
                {listDom}
              </ProCard>
            );
          }}
        >
          {/* <Collapse>
            <Panel header={record?.name} key={1}> */}
          <ProFormGroup style={{ padding: "10px" }}>
            <ProFormText name="name" label="产品码" />
            <ProFormText name="nickName" label="产品版本" />
            <ProForm.Item name="test1" label="测试1">
              <Select
                options={[
                  {
                    value: "333",
                    label: "333",
                  },
                ]}
              />
            </ProForm.Item>
          </ProFormGroup>
          <ProFormList
            name="labels"
            label="用户信息"
            // initialValue={[
            //   {
            //     value: "333",
            //     label: "333",
            //   },
            // ]}
            copyIconProps={false}
            deleteIconProps={{
              tooltipText: "不需要这行了",
            }}
          >
            <ProFormGroup key="group">
              <ProFormText name="value" label="值" />
              <ProFormText name="label" label="显示名称" />
            </ProFormGroup>
          </ProFormList>
          {/* </Panel>
          </Collapse> */}
        </ProFormList>
      </ProForm>
    );
  };
  
  export default Demo;